package edu.yzu.testspringboot002.convert;


import edu.yzu.testspringboot002.po.Menu;
import edu.yzu.testspringboot002.po.dto.SysMenuDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValuePropertyMappingStrategy;

import java.util.List;

/**
 * 菜单转换映射器
 *
 * @author yulang
 * @date 2023-08-18
 */

@Mapper(
        componentModel = "spring",
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE
)
public interface MenuConvertMapper {



    @Mapping(source = "type",target = "menuType")
    List<SysMenuDTO> toSysMenuDTOList(List<Menu> menuList);



    @Mapping(target= "type",source = "menuType")
    SysMenuDTO toSysMenuDTO(Menu menu);





    @Mapping(source = "type",target = "menuType")
    Menu toSysMenuPO(SysMenuDTO sysMenuDTO);
}

